#ifndef DATA_ACQUISATION_H
#define DATA_ACQUISATION_H

#include <QThread>
#include "warn.h"
#include <QQueue>
#include <QFile>
#include <QBitArray>


class data_acquisation : public QThread
{
    Q_OBJECT
public:
    explicit data_acquisation(QObject *parent = 0);
    ~data_acquisation();
    void run();
    inline void append(uchar c2);
    void stop();

signals:

public slots:

private:

     char buf[10];//不要取大于读取所需的缓存，否则出现段错误
     char cmd_array[2];
     uchar count1;
     uchar count2;

     bool light;
     bool cmd_send_err;
     int tty3_fd;
     int high_temperature_adjust;
     int mid_temperature_adjust;
     int low_temperature_adjust;
     int average_temperature_adjust;
     int positive_pressure_adjust;
     int negative_pressure_adjust;
     int normal_pressure_adjust;
     int read_in_num;
     int wrote_num;
     int i;
     int PSU_buf;
     int PSU_adjust;
     int TEM_buf;
     int TEM_adjust;
     int next_read_num;
     int input_data;
     int command_start_addr;
     QBitArray IO_bitarray;
     QByteArray bytearray;

     QFile ttyfile;

     void read_data();
     void old_read_ad();
     void readinput();
     void command_output();
     void AD_value_compensate();
     void IO_input_process();
};

#endif // DATA_ACQUISATION_H
